//社保信息管理 处理窗体
Ext.define("SHApp.CompanyManage.ProductInfo.Form", {
    extend: "BLBTSystem.Form",
    requires: ['SHApp.CompanyManage.ProductInfo.SocialInsuranceComboBox',
    'SHApp.System.AdministrativeArea.AreaComboBox'],
    submitUrl: "api/productinfo?format=json",
    winWidth: 665,
    winHeight: 275,
    txtAreaCode: "_txtAreaCode",
    txtRatioId: "_txtRatioId",
    cmbCityTreeID: "_cmbCityTreeID",
    initComponent: function () {
        Ext.apply(this);
        this.txtAreaCode += this.id;
        this.txtRatioId += this.id;
        this.cmbCityTreeID += this.id;
        this.createItems();
        this.callParent(arguments);
    },
    createItems: function () {
        var me = this;
        this.items = [{
            width: 300,
            border: false,
            bodyStyle: "background:#DFE9F6",
            layout: { type: "vbox", align: "stretch" },
            items: [
				{
				    xtype: "textfield",
				    fieldLabel: "ID",
				    name: "Id",
				    hidden: true
				}, {
				    fieldLabel: "<span style='color:red'>*</span>城市编号",
				    allowBlank: false,
				    blankText: "请输入城市编号!",
				    xtype: "textfield",
				    name: "AreaName",
				    maxLength: 50,
				    id: this.txtAreaCode,
				    hidden: true
				}, {
				    fieldLabel: "<span style='color:red'>*</span>城市",
				    allowBlank: false,
				    blankText: "请选择城市!",
				    xtype: "areacmbtree",
				    name: "AreaCode",
				    maxLength: 100,
				    id: me.cmbCityTreeID,
				    listeners: {
				        select: function (cmb, rs, opt) {
				            if (rs != null) {
				                me.down("#" + me.txtAreaCode).setValue(cmb.getTextValue());
				            }
				        }
				    }
				}, {
				    xtype: 'maintenComboBox',
				    fieldLabel: "<span style='color:red'>*</span>社保类型",
				    matchClass: "社保类型",
				    name: 'ProductType',
				    allowBlank: false,
				    blankText: "请选择社保类型!",
				    maxLength: 50,
				    matchFieldWidth: true
				}, {
				    fieldLabel: "<span style='color:red'>*</span>社保名称",
				    allowBlank: false,
				    blankText: "请输入社保名称!",
				    xtype: "textfield",
				    name: "ProductName",
				    maxLength: 50
				}, {
				    fieldLabel: "<span style='color:red'>*</span>比例名称",
				    allowBlank: false,
				    blankText: "请选择比例名称!",
				    xtype: "socialInsuranceComboBox",
				    name: "RatioId",
				    maxLength: 50,
				    listeners: {
				        select: function (cmb, rs, opts) {
				            if (rs != null && rs.length > 0) {
				                me.down("#" + me.txtRatioId).setValue(rs[0].data.Name);
				            }
				        }
				    }
				}, {
				    fieldLabel: "<span style='color:red'>*</span>比例Id",
				    allowBlank: false,
				    blankText: "请输入比例Id!",
				    xtype: "textfield",
				    name: "RatioName",
				    maxLength: 50,
				    hidden: true,
				    id: this.txtRatioId
				}, {
				    fieldLabel: "<span style='color:red'>*</span>收费频率",
				    allowBlank: false,
				    blankText: "请选择收费频率!",
				    xtype: "maintenComboBox",
				    name: "PayFrequency",
				    matchClass: "收费频率",
				    maxLength: 50,
				    matchFieldWidth: true
				}, {
				    fieldLabel: "缴费月份",
				    xtype: "monthfield",
				    name: "PayMonth",
				    maxLength: 50
				}]
        }, {
            width: 300,
            border: false,
            bodyStyle: "background:#DFE9F6",
            layout: { type: "vbox", align: "stretch" },
            items: [{
                fieldLabel: "调整基数月份",
                xtype: "monthfield",
                name: "AdjustBaseMonth",
                maxLength: 50
            }, {
                xtype: "cmbMonth",
                fieldLabel: "办理日期",
                // value: new Date(),
                name: "TransactDate"
                // format: 'Y-m-d'
            }, {
                xtype: "cmbMonth",
                fieldLabel: "停办日期",
                name: "SuspendDate"

            }, {
                fieldLabel: "<span style='color:red'>*</span>停办方式",
                allowBlank: false,
                blankText: "请选择停办方式!",
                xtype: "maintenComboBox",
                matchClass: "停办方式",
                matchFieldWidth: true,
                name: "SuspendWay",
                maxLength: 50
            }, {
                fieldLabel: "<span style='color:red'>*</span>托收方式",
                allowBlank: false,
                blankText: "请选择托收方式!",
                xtype: "maintenComboBox",
                matchClass: "托收方式",
                matchFieldWidth: true,
                name: "CollectionWay",
                maxLength: 50
            }]
        }
		];
    }

})